<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/common/commonCss.jsp"/>
<jsp:include page="/common/commonJs.jsp"/>
<script language="javascript" src="${basePath }commonJs/tags/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#todoList_class").addClass("content_hover");
		loadWorkflowType();
		excutePage();
	});
	function select11(){
		$("#searchForm input:hidden[name='pageNo']").val(1);
		excutePage();
	}
	
	//分页
	function excutePage(){
		 var form = $("#searchForm"); //获取一个form的jquery对象
	     var pagebean = new PageBean(form); //实例化一个Pagebean对象，并且设置form对象
	     pagebean.setTableId("table1"); //设置要分页的table的id属性
	     pagebean.setCallback(initTable); //回调函数
	     pagebean.setFootId("pagefoot"); //foot div的id
	     setPagebeanObj(pagebean); //全局化pageBean对象
	     pagebean.doPage(); 
	 } 
	//回调函数,只有一个参数，data为返回数据结果集，也就是MyBatisSuperModel里的results
    //开发人员需要在此函数里写自己的数据填充逻辑,把数据拼到table里
    //注意:分页插件会把table除了第一行和最后一行都删掉，这里填充数据时需要从第二行开始填充
    function initTable(data) {
           $.each(data, function(ind, obj) {
                        var htm = "<tr>";
                        htm += "<td class=\"lv\"><a href=\"${basePath }system/index/jumpWorkflow.shtml?businessKey="+obj.businessKey+"&key="+obj.key+"\">"+obj.businessKey+"</a></td>";
                        htm += "<td>" + obj.procDefName + "</td>";
                        htm += "<td>" + obj.activityName + "</td>";
                        htm += "<td>" + obj.userName + "</td>";
                        htm += "</tr>";
                        $("#table1").find("tr:eq("+ind+")").after(htm);
           });
      }
	
   //页面进入就加载流程类型列表
	function loadWorkflowType(){
		$.ajax({  
            type: "get",  
            url: "${basePath }workflow/queryWorkflowType.shtml",  
            cache: false,
	        async: false,
	        dataType: 'json',  
            data: {},  //没参数可以删除
            success: function (data) {
            	$("#type").append("<option value=''>全部</option>");
            	var type = $("#leaveType").val();
            	$(data).each(function(n){
            		if(this.key == type)
            			$("#type").append("<option value='"+this.key+"' selected>"+this.value+"</option>");
            		else
            			$("#type").append("<option value='"+this.key+"'>"+this.value+"</option>");
    		    });   
            	refreshSelect();
            } ,
            error: function(){  
	            return;  
	        }  
        });  
		
	}
</script>
<title>嘉童游乐中心</title>
</head>
<body class="bg">

<div class="content m_auto">
	<%@include file="../indexPage/index_tab.jsp"%>
    <div class="content_r mt10">
        
        <!----内容---->
        <div class="p20">
            <div class="file_single_dl f14 fixed">
            	<form action="${basePath }system/index/findTodoTask.shtml" method="post" id="searchForm" name="searchForm">
    				<input type="hidden" name="pageSize" value="10" />
    				<input type="hidden" name="pageNo" value="1" />
                <dl class="fixed" style="overflow:hidden">
                    <dd><label>工单号：</label><input type="text" class="iput_t w200" name="order"/></dd>
                    <dd><label>工单类型：</label>
                        <div class="uboxstyle">
                            <select name="type" id="type">
                               
                            </select>
                        </div>
                    </dd>
                    <!-- <dd><label>工单时间：</label>
                        <input title="" type="text" name="date1" id="date1"
                        onClick="WdatePicker({dateFmt:'yyyy/MM/dd',isShowWeek:true,isShowClear:true,readOnly:true})"
                        class="Wdate iput_t w82" readonly /><span class="mlr5">至</span><input title="" type="text" name="date1" id="date1"
                        onClick="WdatePicker({dateFmt:'yyyy/MM/dd',isShowWeek:true,isShowClear:true,readOnly:true})"
                        class="Wdate iput_t w82" readonly />
                    </dd> -->
                    <dd class="fr"><input type="button" id="searchBtn" class="btn fr m010" value="查询" onclick="select11();" /></dd>
                </dl>
                </form>
            </div>
            <div class="tab_normal mt10">
                <table class="table" id="table1">
                    <tr>
                        <th>工单</th>
                        <th>流程</th>
                        <th>待办事项</th>
                        <th>申请人</th>
                    </tr>
                </table>
              <!---翻页-->
            <div class="page fr m10" id="pagefoot">
            </div>
            </div>
        </div>
        <!-----内容---->
    </div>
</div>

</body>
</html>